package cn.wh.util;

import cn.wh.entity.User;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author wanghao
 * @Date 2022/5/1 16:37
 * @Description: TODO
 */

public class BaseUtil {
    @Resource
    private RedisUtil redisUtil;
    @Resource
    private HttpServletRequest request;

    public User getUser() {
        String token = request.getHeader("token");
        return (User) redisUtil.get(token);
    }

}
